import org.apache.spark.sql.{Row, SparkSession}


object StudentHive {
  def main(args: Array[String]) {

    val ss = SparkSession.builder()
      .appName("DeviceLoc_Hdfs_To_Hive_Job")
      .enableHiveSupport()
      .getOrCreate()


    val studentRDD = ss.sql("select * from sparktest.student").rdd
    studentRDD.foreach(t => println("Name:"+t(1)+",Gender:"+t(2)+",Age:"+t(3)))
  }

}
